1. Technical Field
The present invention relates to event handling in compositional applications, and more particularly, to using replanning to react to events by reconfiguring deployed applications based on information obtained through event notifications.
2. Discussion of the Related Art
Significant time and cost savings in software development can be achieved by the reuse of components. Reuse is typically achieved by defining an interface of a component, implementing components that support the interface, and then, creating an application by connecting components with compatible externalized interfaces. This allows reuse of the same component code in different applications. The connections between the components (e.g., “bindings” of the components) can be established by connecting providers and consumers of an interface statically at the time of compiling an application, dynamically at application startup, or dynamically while running the application.
Dynamic binding of components enables a shorter cycle of application development. Dynamic binding has been popularized by scripting languages such as Ruby, and dynamic building frameworks developed for JAVA™, such as Spring, OSGi Service Platform and IBM Assemble Zero. Dynamic binding is extremely useful in distributed systems, where components or sources run on remote sites, and the clients may not be able to recompile components to establish the bindings. Some examples of reuse achieved through dynamic binding of externalized interfaces in distributed systems are Web Services, Grid, Stream Processing and systems for online processing of syndication feeds (e.g., YAHOO™ Pipes and/n sofware's RSSBus).
Automatic Application Composition Using Planning
Automated planning can be used to create composite applications in compositional architectures, such as web services, and stream processing. The applications are processing graphs composed of smaller modular components, such as service invocations, or other (smaller) processing graphs.
In many scenarios the components are service invocations (such as web service invocations or an invocation of a method of a JAVA™ class), and can be described in terms of their data effects and preconditions. In particular, we assume that a description (such as WSDL or JAVA™ object code with optional metadata annotations) of each service specifies the input requirements of the service (such as data type, semantics, access control labels, etc.). We refer to these input requirements as preconditions of service invocation, or simply preconditions. The description also specifies the effects of the service, describing the outputs of the service, including information such as data type, semantics, etc. In general, a service description may describe outputs as a function of inputs, so that the description of the output can only be fully determined once the specific inputs of the service have been determined. Note that in practical implementations the invocations can be synchronous, such as subroutine or RPC calls, or asynchronous, such as asynchronous procedure calls, message exchange or message flow.
Under these assumptions, an automated planner can be used to automatically assemble processing graphs based on a user-provided description of the desired output of the application. The descriptions of the components are provided to the planner in the form of a domain description. The planner can also take into account the specification of available primal inputs to the processing graphs, if not all inputs are available for a particular planning request.
The planner composes processing graphs by connecting components, starting from the primal inputs. It evaluates possible combinations of components, by computing descriptions of component outputs, and comparing them to preconditions of components connected to the output. More than one component input can be connected to one component output or one primal input. Logically, this amounts to sending multiple copies of data produced by the component output, with one copy sent to each of the inputs. In practical implementation these do not have to be copies, and it is possible to pass data by reference instead of by value. The process terminates when an output of a component (or a set of outputs taken together) satisfy the conditions specified in the user requirement. Note that all conditions are evaluated at plan time, before any applications are deployed or executed.
If multiple alternative compositional applications can be constructed and shown to satisfy the same request, the planner may use heuristics and utility functions to rank the alternatives and selected preferred plans.
The application, i.e., the processing graph, once composed, is deployed in an execution environment and can be executed.
Examples of a planner and an execution environment are described in Zhen Liu, Anand Ranganathan and Anton Riabov, “A Planning Approach for Message-Oriented Semantic Web Service Composition”, in AAAI-2007.
Similar work has been done in the contexts of Stream Processing, Web Services and Grid Computing.
The components comprising the application can fail. This is a problem in usage scenarios where the components are implemented by web services, which are distributed. Access network failures, as well as denial of service attacks or software failures may cause individual web services to stop functioning.
Event Notification
Event and notification systems, such as JMS (JAVA™ Message Service,) are a common design pattern used in software engineering. These systems are used when one software component needs to be notified of the changes in other components. Similarly, in database management systems, such as IBM DB2, triggers can be defined in order to react to changes in the data.
Event handler procedure code, in practice, can become very complex and difficult to write and maintain, depending on the application. In compositional applications often no single component has access to interfaces and/or information required to handle events correctly. This is largely due to the fact that the components are designed to be reusable in multiple applications, but event handling procedures differ between applications.